<template>
	<view>
		<u-popup :show="show" :round="10" mode="center" @open="open">
			<view class="pwd-popup">
				<view class="flex">
					<view class="font-16 text-bold w-100 text-center">激活账号</view>
					<u-icon name="close" size="24" @click="close"></u-icon>
				</view>
				<view class="item">
					<input type="number" placeholder="请输入手机号" v-model="mobile" />
				</view>
				<view class="bottomBtn" @tap="submit">确认激活</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	import {
		facilitatorActivate
	} from '@/common/api/customer.js'
	export default {
		data() {
			return {
				show: false,
				mobile: ''
			};
		},
		methods: {
			submit() {
				if(!this.mobile) {
					return this.$msg('请输入手机号')
				}
				if(this.mobile.length != 11) {
					return this.$msg('请输入11位数手机号')
				}
				facilitatorActivate({mobile: this.mobile}).then(res => {
					if(res.code == 200) {
						this.show = false
						this.mobile = ''
						this.$msg('激活成功')
					} else {
						this.$msg(res.msg)
					}
				})
			},
			open() {
				
			},
			close() {
				this.show = false
			},
		}
	}
</script>

<style lang="scss" scoped>
.pwd-popup {
	border-radius: 40rpx;
	padding: 40rpx;
	
	.bottomBtn {
		width: 622rpx;
		height: 88rpx;
		background: linear-gradient(42deg, #FF0804 0%, #FC7844 100%);
		box-shadow: 0 2rpx 10rpx 1rpx rgba(250,49,33,0.24);
		border-radius: 16rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		font-size: 32rpx;
		color: #ffffff;
		margin: 80rpx auto 10rpx auto;
	}
	.item {
		height: 92rpx;
		line-height: 92rpx;
		background: #F2F3F5;
		border-radius: 10rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		margin-top: 60rpx;
		input {
			width: 100%;
			padding-left: 30rpx;
		}
	}
}
</style>